import request from '../../utils/request'

// 查询班组信息列表
export function listInf(query) {
  return request({
    url: '/kyhs/team-class/select-by-names',
    method: 'get',
    params: {
      page: query.pageNumber,
      pageSize: query.pageSize,
      deptId: query.deptId,
      nickName: query.nickName,
      postName: query.postName
    }
  })
}

export function InnerlistInf(query) {
  return request({
    url: '/kyhs/team-class/show-new-inf',
    method: 'get',
    params: {
      page: query.pageNumber,
      pageSize: query.pageSize,
      deptId: query.deptId
    }
  })
}

// 新增班组信息
export function addInf(selection, deptId) {
  return request({
    url: '/kyhs/team-class/save-by-names',
    method: 'post',
    params: {
      deptId: deptId
    },
    data: {
      teamClassInfs: selection
    }
  })
}

// 修改班组信息
export function updateInf(data) {
  return request({
    url: '/kyhs/team-class//update-by-name',
    method: 'put',
    data: data
  })
}

// 删除班组信息
export function delInf(data) {
  return request({
    url: '/kyhs/team-class/delete',
    method: 'delete',
    data: data
  })
}

export function getTree() {
  return request({
    url: '/kyhs/table-inf/select-all',
    method: 'get'
  })
}
